package com.zzy;

import org.springframework.context.support.ClassPathXmlApplicationContext;

import java.io.IOException;

public class ProviderRunner {
    public static void main(String[] args) throws IOException {
        ClassPathXmlApplicationContext context = new ClassPathXmlApplicationContext("applicationContext-provider.xml");
        context.start();
        System.out.println("provider start");
        int x = System.in.read();
    }

    //尝试 让 spring 自己去启动 尝试 失败
    public void runProvider(){
        try{
            ClassPathXmlApplicationContext context = new ClassPathXmlApplicationContext("applicationContext-provider.xml");
            context.start();
            System.out.println("provider start");
            int x = System.in.read();
        }catch (Exception e){
            e.printStackTrace();
        }
    }
}


